Optimal. Leaf size=72 \[ -\frac {\sec ^2(c+d x) \left (a b \sin (c+d x)+b^2\right )}{4 d}-\frac {a b \tanh ^{-1}(\sin (c+d x))}{4 d}+\frac {\sec ^4(c+d x) (a+b \sin (c+d x))^2}{4 d} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.10, antiderivative size = 72, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 5, integrand size = 27, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.185, Rules used = {2837, 12, 821, 639, 206} \[ -\frac {\sec ^2(c+d x) \left (a b \sin (c+d x)+b^2\right )}{4 d}-\frac {a b \tanh ^{-1}(\sin (c+d x))}{4 d}+\frac {\sec ^4(c+d x) (a+b \sin (c+d x))^2}{4 d} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 12
Rule 206
Rule 639
Rule 821
Rule 2837
Rubi steps
\begin {align*} \int \sec ^4(c+d x) (a+b \sin (c+d x))^2 \tan (c+d x) \, dx &=\frac {b^5 \operatorname {Subst}\left (\int \frac {x (a+x)^2}{b \left (b^2-x^2\right )^3} \, dx,x,b \sin (c+d x)\right )}{d}\\ &=\frac {b^4 \operatorname {Subst}\left (\int \frac {x (a+x)^2}{\left (b^2-x^2\right )^3} \, dx,x,b \sin (c+d x)\right )}{d}\\ &=\frac {\sec ^4(c+d x) (a+b \sin (c+d x))^2}{4 d}-\frac {b^2 \operatorname {Subst}\left (\int \frac {2 b^2 (a+x)}{\left (b^2-x^2\right )^2} \, dx,x,b \sin (c+d x)\right )}{4 d}\\ &=\frac {\sec ^4(c+d x) (a+b \sin (c+d x))^2}{4 d}-\frac {b^4 \operatorname {Subst}\left (\int \frac {a+x}{\left (b^2-x^2\right )^2} \, dx,x,b \sin (c+d x)\right )}{2 d}\\ &=\frac {\sec ^4(c+d x) (a+b \sin (c+d x))^2}{4 d}-\frac {\sec ^2(c+d x) \left (b^2+a b \sin (c+d x)\right )}{4 d}-\frac {\left (a b^2\right ) \operatorname {Subst}\left (\int \frac {1}{b^2-x^2} \, dx,x,b \sin (c+d x)\right )}{4 d}\\ &=-\frac {a b \tanh ^{-1}(\sin (c+d x))}{4 d}+\frac {\sec ^4(c+d x) (a+b \sin (c+d x))^2}{4 d}-\frac {\sec ^2(c+d x) \left (b^2+a b \sin (c+d x)\right )}{4 d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [B] time = 2.94, size = 215, normalized size = 2.99 \[ \frac {2 a^4 b^2 \sec ^2(c+d x)+a b \left (a^2-b^2\right )^2 (\log (1-\sin (c+d x))-\log (\sin (c+d x)+1))-2 a b \left (a^2-b^2\right ) \tan (c+d x) \sec (c+d x) \left (a^2+2 b^2 \tan ^2(c+d x)+b^2\right )+2 b^4 \left (b^2-a^2\right ) \tan ^4(c+d x)+b \left (4 a^2 b^3-6 a^4 b\right ) \tan ^2(c+d x)+2 a^4 \left (a^2-b^2\right ) \sec ^4(c+d x)+4 a^3 b \left (a^2-b^2\right ) \tan (c+d x) \sec ^3(c+d x)}{8 d \left (a^2-b^2\right )^2} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 0.44, size = 104, normalized size = 1.44 \[ -\frac {a b \cos \left (d x + c\right )^{4} \log \left (\sin \left (d x + c\right ) + 1\right ) - a b \cos \left (d x + c\right )^{4} \log \left (-\sin \left (d x + c\right ) + 1\right ) + 4 \, b^{2} \cos \left (d x + c\right )^{2} - 2 \, a^{2} - 2 \, b^{2} + 2 \, {\left (a b \cos \left (d x + c\right )^{2} - 2 \, a b\right )} \sin \left (d x + c\right )}{8 \, d \cos \left (d x + c\right )^{4}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [A] time = 0.24, size = 89, normalized size = 1.24 \[ -\frac {a b \log \left ({\left | \sin \left (d x + c\right ) + 1 \right |}\right ) - a b \log \left ({\left | \sin \left (d x + c\right ) - 1 \right |}\right ) - \frac {2 \, {\left (a b \sin \left (d x + c\right )^{3} + 2 \, b^{2} \sin \left (d x + c\right )^{2} + a b \sin \left (d x + c\right ) + a^{2} - b^{2}\right )}}{{\left (\sin \left (d x + c\right )^{2} - 1\right )}^{2}}}{8 \, d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.26, size = 122, normalized size = 1.69 \[ \frac {a^{2}}{4 d \cos \left (d x +c \right )^{4}}+\frac {a b \left (\sin ^{3}\left (d x +c \right )\right )}{2 d \cos \left (d x +c \right )^{4}}+\frac {a b \left (\sin ^{3}\left (d x +c \right )\right )}{4 d \cos \left (d x +c \right )^{2}}+\frac {a b \sin \left (d x +c \right )}{4 d}-\frac {a b \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{4 d}+\frac {b^{2} \left (\sin ^{4}\left (d x +c \right )\right )}{4 d \cos \left (d x +c \right )^{4}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [A] time = 0.39, size = 97, normalized size = 1.35 \[ -\frac {a b \log \left (\sin \left (d x + c\right ) + 1\right ) - a b \log \left (\sin \left (d x + c\right ) - 1\right ) - \frac {2 \, {\left (a b \sin \left (d x + c\right )^{3} + 2 \, b^{2} \sin \left (d x + c\right )^{2} + a b \sin \left (d x + c\right ) + a^{2} - b^{2}\right )}}{\sin \left (d x + c\right )^{4} - 2 \, \sin \left (d x + c\right )^{2} + 1}}{8 \, d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 18.87, size = 183, normalized size = 2.54 \[ \frac {2\,a^2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6+2\,a^2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+\frac {a\,b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^7}{2}+\frac {7\,a\,b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5}{2}+\frac {7\,a\,b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3}{2}+\frac {a\,b\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{2}+4\,b^2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4}{d\,\left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^8-4\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6+6\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4-4\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+1\right )}-\frac {a\,b\,\mathrm {atanh}\left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )}{2\,d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [F(-1)] time = 0.00, size = 0, normalized size = 0.00 \[ \text {Timed out} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________